<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>设置返回结果集偏移量和数目</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="sphinxclient.setindexweights.html">SphinxClient::setIndexWeights</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="sphinxclient.setmatchmode.html">SphinxClient::setMatchMode</a></div>
 <div class="up"><a href="class.sphinxclient.html">SphinxClient</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="sphinxclient.setlimits" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SphinxClient::setLimits</h1>
  <p class="verinfo">(PECL sphinx &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">SphinxClient::setLimits</span> &mdash; <span class="dc-title">设置返回结果集偏移量和数目</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-sphinxclient.setlimits-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>SphinxClient::setLimits</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$offset</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$limit</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$max_matches</code><span class="initializer"> = 0</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$cutoff</code><span class="initializer"> = 0</span></span>
  ]] )</div>

  <p class="para rdfs-comment">
   给服务器端结果集设置一个偏移量 <em><code class="parameter">offset</code></em> 从那个偏移量起向客户端返回的匹配项数目限制(<em><code class="parameter">limit</code></em>)
   . 并且可以在服务器端设定当前查询的结果集大小
   (<em><code class="parameter">max_matches</code></em>) ，另有一个阈值 (<em><code class="parameter">cutoff</code></em>)，当找到的匹配项达到这个阀值时就停止搜索。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-sphinxclient.setlimits-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">offset</code></em></dt>

     <dd>

      <p class="para">
       结果集的偏移量.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">limit</code></em></dt>

     <dd>

      <p class="para">
       返回的匹配项数目.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">max_matches</code></em></dt>

     <dd>

      <p class="para">
       设置控制搜索过程中searchd在内存中所保持的匹配项数目.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">cutoff</code></em></dt>

     <dd>

      <p class="para">
       该设置是为高级性能优化而提供的. 它告诉searchd 在找到并处理 <em><code class="parameter">cutoff</code></em> 个匹配后就强制停止.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-sphinxclient.setlimits-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="sphinxclient.setindexweights.html">SphinxClient::setIndexWeights</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="sphinxclient.setmatchmode.html">SphinxClient::setMatchMode</a></div>
 <div class="up"><a href="class.sphinxclient.html">SphinxClient</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
